package cn.restcloud.springboot.listener;

import org.springframework.core.env.PropertySource;

public class RestCloudConfigPropertySource extends PropertySource<RestCloudConfigCenterSource>{
	public static final String RANDOM_SERVER_PORT_PROPERTY_SOURCE_NAME = "RestCloudConfigCenter";

    public RestCloudConfigPropertySource(String name) {
        super(name, new RestCloudConfigCenterSource());
    }

    public RestCloudConfigPropertySource() {
        this(RANDOM_SERVER_PORT_PROPERTY_SOURCE_NAME);
    }

    public RestCloudConfigPropertySource(String name, RestCloudConfigCenterSource source) {
        super(name, source);
    }

    @Override
    public Object getProperty(String name) {
    	//这里调用restcloud的配置数据返回配置值
    	Object value=this.getSource().getConfig(name);
        return value;
    }
}
